#!/bin/bash

echo "停止现有容器..."
docker stop schedulingsystem-app-1 || true
docker rm schedulingsystem-app-1 || true

echo "重新构建前端镜像..."
docker build --pull=false -t schedulingsystem-frontend:latest ./frontend

echo "重新构建后端镜像..."
docker build --pull=false -t schedulingsystem-backend:latest ./backend

echo "启动服务..."
docker compose up -d

echo "服务已启动，可以通过以下地址访问："
echo "前端: http://localhost:80"
echo "后端: http://localhost:8080/api"
echo "查看日志: docker compose logs -f" 